<template>
  <div class="container">
    <topNav :toLastPath='true'>认证信息</topNav>
    <ul>
      <li @click="personalGo">       
          <span>个人实名认证</span>
          <span>></span>
          <span>{{personal}}</span>
      </li>
      <li @click="companyGo">
          <span>企业实名认证</span>
          <span>></span>
          <span>{{company}}</span>
      </li>
    </ul>
  </div>
</template>

<script>
import topNav from '@/components/topNav'
export default {
  data () {
    return {
      personal:'',
      personal:'',
      company:'',
      company_info:''
    }
  },

  components: {
    topNav
  },

  methods: {
    personalGo(){
      
      // if(this.company_info==0){
      //     this.$router.push({name:'enterpriseResume',params:{type:'personal'}})
      //     return
      // }else if(this.personal!='认证中'){
      //     this.$router.push('/me/authentication/personal')
      // }
      if(this.personal!='认证中'){
          this.$router.push({name:'enterpriseResume',params:{type:'personal'}})
      }
      
    },
    companyGo(){
      // if(this.company_info==0){
      //     this.$router.push({name:'enterpriseResume',params:{type:'personal'}})
      //     return
      // }
      // if(this.company!='认证中'){
      //   if(this.company=='未认证' ||this.company=='认证失败'){
      //     this.$router.push('/me/authentication/enterprise')
      //   }else{
      //     this.$router.push('/me/authentication/enterprise')
      //   }
      // }
      if(this.company!='认证中'){
        this.$router.push({name:'enterpriseResume',params:{type:'company'}})
      }
    }
  },

  async activated(){
    let userToken=window.localStorage.getItem('userToken')
    let personal=await this.$axios('/cert/judCertDeta',{params:{user_token:userToken}});
    let data=personal.data.data
    this.personal_auth=data.personal_auth
    this.company_auth=data.company_auth
    this.company_info=data.company_info
    if(this.personal_auth==0){
      this.personal='未认证'
    }else if(this.personal_auth==1){
      this.personal='已认证'
    }else if(this.personal_auth==2){
      this.personal='认证中'
    }else if(this.personal_auth==3){
      this.personal='认证失败'
    }
    if(this.company_auth==0){
      this.company='未认证'
    }else if(this.company_auth==1){
      this.company='已认证'
    }else if(this.company_auth==2){
      this.company='认证中'
    }else if(this.company_auth==3){
      this.company='认证失败'
    }
  }
}

</script>

<style scoped>
.container{background-color: #F8F8FB;padding-top: 45px;}
.container ul{width: 100%;}
.container ul li{width: 100%;height:60px;background-color: #fff;margin-bottom: 1px;}
.container ul li span{line-height: 60px;}
.container ul li span:nth-of-type(1){font-size: 17px;color: #000000;margin-left: 20px;}
.container ul li span:nth-of-type(2),.container ul li span:nth-of-type(3){font-size:20px;float: right;color: #B2B2B9;margin-right: 10px;}
.container ul li span:nth-of-type(3){font-size:14px;}
</style>
